package com.hcms.admin.aop;

import org.aspectj.lang.JoinPoint;

abstract class BaseAop {

    /**
     * 获取切面中的class类
     * @param joinPoint
     * @param clz
     * @return
     * @param <T>
     */
    public <T> T getType(JoinPoint joinPoint, Class<T> clz) {
        Object[] args = joinPoint.getArgs();
        for (Object arg : args) {
            if (arg != null && arg.getClass() == clz) {
                return (T) arg;
            }
        }
        return null;
    }

}
